package com.zimmur.model.goods;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zimmur.model.base.BaseModel;
import com.zimmur.tools.DateUtils;

public class GoodsOrganization extends BaseModel{
	private static final long serialVersionUID = 1L;

	private Long organizationId=0L;

    private Long goodsId=0L;
    
    private Integer startTime=0;

    private Integer endTime=0;

    private Integer minimum=0;

    private Integer orderNum=0;
    @JsonIgnore
    private String opUser;
    @JsonIgnore
    private Integer updateDate;

    private Short isFinish=0;
    @JsonIgnore
    private Short isRecommend=0;
    
    private Integer sendTime=0; //发货时间
    
	private long day=0;//活动天数
	private long remainTime=0;//剩余时间
	private long waitSendDay=0;//等待发货时间
	
	public long getWaitSendDay() {
		long waitSendDay=DateUtils.DaysBetween(DateUtils.getNowUnixTime(), getSendTime());
		this.waitSendDay=waitSendDay>0?waitSendDay:0;
		return this.waitSendDay;
	}
	
	public long getDay() {
		this.day=DateUtils.DaysBetween(getStartTime(), getEndTime());
		return day;
	}

	public long getRemainTime() {
		long time=getEndTime()-DateUtils.getNowUnixTime();
		this.remainTime=time>0?time:0;
		return this.remainTime;
	}
    
	public Integer getSendTime() {
		if(sendTime==null){
			return 0;
		}
		return sendTime;
	}

	public void setSendTime(Integer sendTime) {
		this.sendTime = sendTime;
	}

	public Short getIsRecommend() {
		return isRecommend;
	}

	public void setIsRecommend(Short isRecommend) {
		this.isRecommend = isRecommend;
	}

	public Long getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(Long organizationId) {
		this.organizationId = organizationId;
	}

	public Long getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Long goodsId) {
		this.goodsId = goodsId;
	}

	public Integer getStartTime() {
		return startTime;
	}

	public void setStartTime(Integer startTime) {
		this.startTime = startTime;
	}

	public Integer getEndTime() {
		return endTime;
	}

	public void setEndTime(Integer endTime) {
		this.endTime = endTime;
	}

	public Integer getMinimum() {
		return minimum;
	}

	public void setMinimum(Integer minimum) {
		this.minimum = minimum;
	}

	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public String getOpUser() {
		return opUser;
	}

	public void setOpUser(String opUser) {
		this.opUser = opUser;
	}

	public Integer getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Integer updateDate) {
		this.updateDate = updateDate;
	}

	public Short getIsFinish() {
		return isFinish;
	}

	public void setIsFinish(Short isFinish) {
		this.isFinish = isFinish;
	}

    
}